﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.WCS.Domain.EntityInfo;
using Zocono.WCS.Domain.RouteDomain;
using Zocono.WCS.Infrastructure.ApllicationDto.WCSTaskDto;
using Zocono.WCS.Infrastructure.ApllicationDto;

namespace Zocono.WCS.Application.AppConfigureManage
{
    public class RouteInfoApp
    {
        private readonly IRouteInfoService _RouteInfoService;
        public RouteInfoApp(IRouteInfoService routeInfoService)
        {
            _RouteInfoService = routeInfoService;
        }

        public async Task<PageDto<RouteInfo>> GetPagedRouteInfoAsync(QueryRouteInfoDto queryRouteInto)
        {
            return await _RouteInfoService.GetPagedRouteInfoAsync(queryRouteInto);
        }

        public async Task<List<RouteInfo>> GetRouteInfoListAsync()
        {
            return await _RouteInfoService.GetRouteInfoListAsync();
        }

        public async Task<bool> CreateRouteInfoAsync(RouteInfo routeInfo)
        {
            return await _RouteInfoService.CreateRouteInfoAsync(routeInfo);
        }

        public async Task<bool> ModifyRouteInfoAsync(RouteInfo routeInfo)
        {
            return await _RouteInfoService.ModifyRouteInfoAsync(routeInfo);
        }

        public async Task<bool> DeleteRouteInfoAsync(List<RouteInfo> routeInfoList)
        {
            return await _RouteInfoService.DeleteRouteInfoAsync(routeInfoList);
        }
        /// <summary>
        /// 通过ID查找数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RouteInfo> GetRouteInfoByIdAsync(long id)
        {
            return await _RouteInfoService.GetRouteInfoByIdAsync(id);
        }
        /// <summary>
        /// 通过ID删除数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<bool> DeleteRouteInfoByIdAsync(long id)
        {
            return await _RouteInfoService.DeleteRouteInfoByIdAsync(id);
        }

        
        /// <summary>
        /// 通过ID查找数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<RouteInfo> GetRouteInfoByFromAndToAsync(string fromStation, string toStation)
        {
            return await _RouteInfoService.GetRouteInfoByFromAndToAsync(fromStation, toStation);
        }

    }
}
